/**
 * 
 */

$(function() {
	$
			.ajax({
				url : "getOverViewInfo.do",
				success : function(data) {
					var result = JSON.parse(data);

					$("#total_of_need_to_calibrate_this_month").find("strong").text(result.totalOfNeedToCalibrateThisMonth);
					$("#total_of_expired").find("strong").text(result.totalOfExpired);
					$("#total_of_lost").find("strong").text(result.totalOfLost);
					$("#total_of_scrapped").find("strong").text(result.totalOfScrapped);
					$("#total_of_gauge").find("strong").text(result.totalOfGauge);
					$("#total_of_bigGauge").find("strong").text(result.totalOfBigGauge);
					$("#total_of_commonGauge").find("strong").text(result.totalOfCommonGauge);

					$(".progress div").each(function() {
						$(this).attr("aria-valuemax", result.totalOfGauge);
					})
					console.log($("#total_of_expired_progress").attr("aria-valuenow"))
					$("#total_of_need_to_calibrate_this_month_progress").attr("aria-valuenow", result.totalOfNeedToCalibrateThisMonth).css("width",result.totalOfNeedToCalibrateThisMonth/result.totalOfGauge*100+"%")
					$("#total_of_expired_progress").attr("aria-valuenow", result.totalOfExpired).css("width",result.totalOfExpired/result.totalOfGauge*100+"%");
					$("#total_of_lost_progress").attr("aria-valuenow", result.totalOfLost).css("width",result.totalOfLost/result.totalOfGauge*100+"%");
					$("#total_of_scrapped_progress").attr("aria-valuenow", result.totalOfScrapped).css("width",result.totalOfScrapped/result.totalOfGauge*100+"%");
				}
			})

})

function setOverViewInfo(result) {

	$("total_of_need_to_calibrate_this_month").find("strong").val(result.totalOfNeedToCalibrateThisMonth);
	$("total_of_expired").find("strong").text(result.totalOfExpired);
	$("total_of_lost").find("strong").text(result.totalOfLost);
	$("total_of_scrapped").find("strong").text(result.totalOfScrapped);
	$("total_of_gauge").find("strong").text(result.totalOfGauge);
	$("total_of_bigGauge").find("strong").text(result.totalOfBigGauge);
	$("total_of_common_gauge").find("strong").text(result.totalOfCommonGauge);

}